﻿<%@ Page Title="QB Rating Calculator" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="QBRatingServiceClient._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1><%: Title %>.</h1>
                <h2>&nbsp;Demonstrates the WCF QB Rating Service in ASP.NET.</h2>
            </hgroup>
            <p>
                This is a sample page that calculates a QB's <mark>NFL and NCAA</mark> passing efficiency ratings.&nbsp;
                It uses the WCF QB Rating Service to perform the ratings calculations.&nbsp;
                For additional information and samples, visit
                <a href="http://jbarkes.blogspot.com" title="Jason Barkes">http://jbarkes.blogspot.com</a>.
            </p>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <asp:Panel ID="pnlStats" runat="server">
    <table>
        <tr><td><asp:Label ID="lblFormula" runat="server" Text="Formula:"></asp:Label></td>
            <td><asp:DropDownList ID="ddlFormula" runat="server">
                <asp:ListItem>NFL</asp:ListItem>
                <asp:ListItem>CFL</asp:ListItem>
                <asp:ListItem>AFL</asp:ListItem>
                <asp:ListItem>NCAA</asp:ListItem>
                <asp:ListItem>HS</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr><td><asp:Label ID="lblComps" runat="server" Text="Completions:"></asp:Label></td>
            <td>
                <asp:TextBox ID="txtComps" CssClass="qb-stat" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvComps" runat="server" CssClass="qb-stat-error" ControlToValidate="txtComps"
                    Text="Completions is required" Display="Dynamic"></asp:RequiredFieldValidator>
                <asp:RangeValidator ID="rvComps" runat="server" CssClass="qb-stat-error" ControlToValidate="txtComps"
                    Text="Please enter a number between 0 and 999999" Display="Dynamic"
                    Type="Integer" MinimumValue="0" MaximumValue="999999"></asp:RangeValidator>
            </td>
        </tr>
        <tr><td><asp:Label ID="lblAtts" runat="server" Text="Attempts:"></asp:Label></td>
            <td><asp:TextBox ID="txtAtts" CssClass="qb-stat" runat="server"></asp:TextBox>
                <asp:Label ID="lblCompletionPercentage" runat="server" Text="00.0%" Visible="False" CssClass="qb-calc-stat"></asp:Label>
                <asp:RequiredFieldValidator ID="rfvAtts" runat="server" CssClass="qb-stat-error" ControlToValidate="txtAtts"
                    Text="Attempts is required" Display="Dynamic"></asp:RequiredFieldValidator>
                <asp:RangeValidator ID="rvAtts" runat="server" CssClass="qb-stat-error" ControlToValidate="txtAtts"
                    Text="Please enter a number between 0 and 999999" Display="Dynamic"
                    Type="Integer" MinimumValue="0" MaximumValue="999999"></asp:RangeValidator>
            </td>
        </tr>
        <tr><td><asp:Label ID="lblYards" runat="server" Text="Passing Yards:"></asp:Label></td>
            <td><asp:TextBox ID="txtYards" CssClass="qb-stat" runat="server"></asp:TextBox>
                <asp:Label ID="lblYardsPerAttempt" runat="server" Text="00.0" Visible="False" CssClass="qb-calc-stat"></asp:Label>
                <asp:RequiredFieldValidator ID="rfvYards" runat="server" CssClass="qb-stat-error" ControlToValidate="txtYards"
                    Text="Passing Yards is required" Display="Dynamic"></asp:RequiredFieldValidator>
                <asp:RangeValidator ID="rvYards" runat="server" CssClass="qb-stat-error" ControlToValidate="txtYards"
                    Text="Please enter a number between 0 and 999999" Display="Dynamic"
                    Type="Integer" MinimumValue="0" MaximumValue="999999"></asp:RangeValidator>
            </td>
        </tr>
        <tr><td><asp:Label ID="lblTds" runat="server" Text="Passing TDs:"></asp:Label></td>
            <td><asp:TextBox ID="txtTds" CssClass="qb-stat" runat="server"></asp:TextBox>
                <asp:Label ID="lblTouchdownPercentage" runat="server" Text="00.0%" Visible="False" CssClass="qb-calc-stat"></asp:Label>
                <asp:RequiredFieldValidator ID="rfvTds" runat="server" CssClass="qb-stat-error" ControlToValidate="txtTds"
                    Text="Passing TDs is required" Display="Dynamic"></asp:RequiredFieldValidator>
                <asp:RangeValidator ID="rvTds" runat="server" CssClass="qb-stat-error" ControlToValidate="txtTds"
                    Text="Please enter a number between 0 and 999999" Display="Dynamic"
                    Type="Integer" MinimumValue="0" MaximumValue="999999"></asp:RangeValidator>
            </td>
        </tr>
        <tr><td><asp:Label ID="lblInts" runat="server" Text="Interceptions:"></asp:Label></td>
            <td><asp:TextBox ID="txtInts" CssClass="qb-stat" runat="server"></asp:TextBox>
                <asp:Label ID="lblInterceptionPercentage" runat="server" Text="00.0%" Visible="False" CssClass="qb-calc-stat"></asp:Label>
                <asp:RequiredFieldValidator ID="rfvInts" runat="server" CssClass="qb-stat-error" ControlToValidate="txtInts"
                    Text="Interceptions is required" Display="Dynamic"></asp:RequiredFieldValidator>
                <asp:RangeValidator ID="rvInts" runat="server" CssClass="qb-stat-error" ControlToValidate="txtInts"
                    Text="Please enter a number between 0 and 999999" Display="Dynamic"
                    Type="Integer" MinimumValue="0" MaximumValue="999999"></asp:RangeValidator>
            </td>
        </tr>
        <tr><td><asp:Label ID="lblRating" runat="server" Text="QB Rating:"></asp:Label></td>
            <td><asp:TextBox ID="txtRating" CssClass="qb-stat" runat="server" ReadOnly="true"></asp:TextBox></td>
        </tr>
        <tr class="btn-row">
            <td colspan="2">
                <asp:Button ID="btnCalc" runat="server" CssClass="btn-calc" Text="Calculate" OnClick="btnCalc_Click" />
                <asp:Button ID="btnReset" runat="server" Text="Clear" OnClick="btnReset_Click" CausesValidation="False" />
            </td>
        </tr>
    </table>
    </asp:Panel>
</asp:Content>
